package com.csc.contact.checkbill.kafkaconfig;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

@Service("kafkaConfig")
public class KafkaProducer {

    @Value("${kafkaConfig.topic}")
    private String topic;

    @Autowired
    private KafkaTemplate<String, String> kafkaTemplate;

    //发送消息方法
    public void send(String message) {
        kafkaTemplate.send(topic,message);
    }


}
